home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacTech 1 to 12
/
MacTech-vol-1-12.toast
/
Reference
/
the cmsp digests ('94-'97)
/
csmp digest Vol 4 No 037
< prev
Wrap
Text File
|
1997-03-06
|
78KB
|
2,343 lines
C.S.M.P. Digest Wed, 05 Mar 97 Volume 4 : Issue 37
Today's Topics:
Any books on PowerPC assembly language?
Basic and Pascal Compiler
Calculating CPU loading time?
Can 'clutType" color tables have more than 256 colors
ControlList
Converting postscript to text
CopyBits
Disable shutdown key?
DrawPicture
Embedding a QuickTime into an app
How do I use BitMapToRegion?
Images In "SimpleText"?..
MRJ and stand-alone Java applications
SFGetFile feeding Finder doc info automatically?
Stereo sound?
The Comp.Sys.Mac.Programmer Digest is moderated by Mark Aiken
(marka@ee.mcgill.ca).
The digest is a collection of article threads from the internet
newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and
csmp.games. It is designed for people who read news semi-regularly and
want an archive of the discussions. If you don't know what a
newsgroup is, you probably don't have access to it. Ask your systems
administrator(s) for details. If you don't have access to news, you
may still be able to post messages to the group by using a mail server
like anon.penet.fi (mail help@anon.penet.fi for more information).
Each issue of the digest contains one or more sets of articles (called
threads), with each set corresponding to a 'discussion' of a particular
subject. The articles are not edited; all articles included in this digest
are in their original posted form (as received by our news server at
ee.mcgill.ca). Article threads are not added to the digest until the last
article added to the thread is at least two weeks old (this is to ensure that
the thread is dead before adding it to the digest). Article threads that
consist of only one message are generally not included in the digest.
The digests can be obtained by email, ftp or through the World Wide Web.
If you want to receive the digest by mail, send email to
majordomo@ee.mcgill.ca with no subject and one of the following commands
as body:
help Sends you a summary of commands
subscribe csmp Adds you to the mailing list
unsubscribe csmp Removes you from the list
Once you have subscribed, you will automatically receive each new
issue as it is created.
Back issues are available by ftp from Info-Mac mirror sites in the
per/csmp subdirectory, e.g.
ftp://sumex-aim.stanford.edu/info-mac/per/csmp/
The contents of all back issues can be searched by accessing the
following URL, courtesy of Andrew Barry (ajbarry@ozemail.com.au):
http://marvin.stattech.com.au/search.html
They can also be searched through the following URLs, thanks to
Tim Tuck (Tim.Tuck@sensei.com.au):
http://wais.sensei.com.au/searchform.html
wais://wais.sensei.com.au:210/csmp?
-------------------------------------------------------
>From golaq@aol.com (Golaq)
Subject: Any books on PowerPC assembly language?
Date: 31 Jan 1997 18:55:07 GMT
Organization: AOL http://www.aol.com
I was wondering if there are any books on assembly language programming
for the PowerPC
+++++++++++++++++++++++++++
>From Tim Humphrey <humphret@lurch.winthrop.edu>
Date: Fri, 31 Jan 1997 14:47:08 -0500 (EST)
Organization: Info Avenue INTERNET Access
On 31 Jan 1997, Golaq wrote:
> I was wondering if there are any books on assembly language programming
> for the PowerPC
Motorola publishes some free books on PowerPC, actually the reference
manuals. If you want to get into assembly language you might want to
check out this web site <http://www.tau.it/lightsoft>. The company that
puts it up, Lightsoft, runs a mailing list where you can post questions
about assembly; details about the mailing list are on the site.
..._Tim_...
--=[You experience as you believe]=--
http://www.winthrop.edu/~humphret
+++++++++++++++++++++++++++
>From cooldog@inreach.com (Loren)
Date: Fri, 31 Jan 1997 15:38:42 -0800
Organization: Cool Dog Graphics
In article <19970131185501.NAA25712@ladder01.news.aol.com>, golaq@aol.com
(Golaq) wrote:
> I was wondering if there are any books on assembly language programming
> for the PowerPC
The only title _I've_ seen is the guide "Assembler for Macintosh With
PowerPC" that came on my Metrowerks CodeWarrior CD. It's a DocViewer
document from Apple, so you might be able to get an electronic or hard-copy
edition from them.
+++++++++++++++++++++++++++
>From trumbull@cs.yale.edu (Ben Trumbull)
Date: Wed, 05 Feb 1997 18:37:21 -0500
Organization: Yale University
In article <19970131185501.NAA25712@ladder01.news.aol.com>, golaq@aol.com
(Golaq) wrote:
> I was wondering if there are any books on assembly language programming
> for the PowerPC
"Optimizing PowerPC Code" by Gary Kacmarcik is great. But it's not an
assembly language tutorial.
terminally curious,
Ben
___________________________________________________________________
Benjamin Trumbull
trumbull@cs.yale.edu
Yale University
You can't be in hell; you can still read your e-mail
---------------------------
>From pfannkuchcf@bvu.edu (Colin F. Pfannkuch)
Subject: Basic and Pascal Compiler
Date: 4 Feb 97 13:56:07 CDT
Organization: Buena Vista University, Storm Lake, IA
I am looking for Basic and Pascal compilers for Macs (I was initially looking
for Quick Basic and Turbo Pascal, but they apparently aren't made anymore).
The compiler is to be used by High School Students.
I am having trouble finding any compilers at all. Any suggestions about what
compilers are out and what ones are the best is greatly appreciated.
Colin F. Pfannkuch
pfannkuchcf@bvu.edu
+++++++++++++++++++++++++++
>From Steve@emer.com (Steve Wilson)
Date: 4 Feb 1997 22:04:31 GMT
Organization: Emergent Behavior
In article <1997Feb4.135607.13976@bvu.edu>, pfannkuchcf@bvu.edu (Colin F.
Pfannkuch) wrote:
> I am looking for Basic and Pascal compilers for Macs (I was initially looking
> for Quick Basic and Turbo Pascal, but they apparently aren't made anymore).
> The compiler is to be used by High School Students.
> I am having trouble finding any compilers at all. Any suggestions about what
> compilers are out and what ones are the best is greatly appreciated.
Metrowerks has a pascal compiler. There have academic discounts.
<http://www.metrowerks.com>.
There are also several shareware Basic products. Chipmunk basic seems to
be highly recommended, but I haven't used it.
I'd also check out Prograph classic. It's a freeware environment for
visual programming. It's very cool. <http://www.pictorius.com>.
Steve Wilson
Lead Developer of Spreadsheet 2000
Emergent Behavior
(415) 494-6763
Fax (415) 494-0570
mailto:Steve@emer.com
http://www.emer.com
http://members.aol.com/wilsonsd
+++++++++++++++++++++++++++
>From "Thomas L. Ferrell" <f44@ornl.NoSpam.gov>
Date: 5 Feb 1997 05:28:21 GMT
Organization: Oak Ridge National Lab
Steve@emer.com (Steve Wilson) wrote:
>In article <1997Feb4.135607.13976@bvu.edu>, pfannkuchcf@bvu.edu (Colin F.
>Pfannkuch) wrote:
>
>> I am looking for Basic and Pascal compilers for Macs (I was initially looking
>> for Quick Basic and Turbo Pascal, but they apparently aren't made anymore).
>> The compiler is to be used by High School Students.
>> I am having trouble finding any compilers at all. Any suggestions about what
>> compilers are out and what ones are the best is greatly appreciated.
>
>Metrowerks has a pascal compiler. There have academic discounts.
><http://www.metrowerks.com>.
>
>There are also several shareware Basic products. Chipmunk basic seems to
>be highly recommended, but I haven't used it.
>
>I'd also check out Prograph classic. It's a freeware environment for
>visual programming. It's very cool. <http://www.pictorius.com>.
>
>Steve Wilson
>Lead Developer of Spreadsheet 2000
>Emergent Behavior
>(415) 494-6763
>Fax (415) 494-0570
>mailto:Steve@emer.com
>http://www.emer.com
>http://members.aol.com/wilsonsd
Chipmunk is great and is free,but it's just an interpreter. True Basic, the Professional kit, has a compiler, as does Future Basic, =
and (indirectly) VIP Basic. See
http://www.fys.ruu.nl/~bergmann/basic.html
tom
(Please remove NoSpam from my email address to reply)
---------------------------
>From jaeho@xs4all.nl (Jae Ho Chang)
Subject: Calculating CPU loading time?
Date: 16 Feb 1997 21:07:30 GMT
Organization: XS4ALL, networking for the masses
How can I calculate the CPU loading time (in percentage)?
Thanks,
Jae Ho Chang :-)
--
* Sound from Chaos? Visit Chaotic Sound Synthesis Lab.
* Looking for cool Macintosh note utility? Check out FinderNote.
at <http://www.xs4all.nl/~jaeho/index.html>
+++++++++++++++++++++++++++
>From darth@zfn.uni-bremen.de (Jochen Lippert)
Date: Sun, 16 Feb 1997 22:20:23 +0100
Organization: University of Bremen
In article <jaeho-1602972210340001@ztm06-06.dial.xs4all.nl>,
jaeho@xs4all.nl (Jae Ho Chang) wrote:
> How can I calculate the CPU loading time (in percentage)?
> Thanks,
One way would be using the Sound Manager, there is a SoundCommand that
measures CPU load.
Jochen Lippert
darth@zfn.uni-bremen.de
+++++++++++++++++++++++++++
>From smfr@santafe.edu (Simon Fraser)
Date: Sun, 16 Feb 1997 21:45:27 -0700
Organization: Santa Fe Institute
In article <darth-1602972220230001@m08.informatik.uni-bremen.de>,
darth@zfn.uni-bremen.de (Jochen Lippert) wrote:
> In article <jaeho-1602972210340001@ztm06-06.dial.xs4all.nl>,
> jaeho@xs4all.nl (Jae Ho Chang) wrote:
>
> > How can I calculate the CPU loading time (in percentage)?
> > Thanks,
>
> One way would be using the Sound Manager, there is a SoundCommand that
> measures CPU load.
You could also might be able to use the Process Manager, which accumulates
a count of the number of ticks used by each process.
Simon
---------------------------
>From stonerfish@aol.com (Stonerfish)
Subject: Can 'clutType" color tables have more than 256 colors
Date: 8 Feb 1997 06:51:37 GMT
Organization: AOL http://www.aol.com
I need to know if a colorTable from a pixel map can have more than ( or
less than ) 256
colors and meet the following conditions.
The color table must be "clutType".
The pix map pixel type must be "chunky".
The device must be a screen device.
I know that monitors can display from 1 to millions of colors but have
only seen "clutType"
color tables use 256 colors. I have access to only 2 macs.
Any info on colorTables would be a help
Email me if you have the time.
Thanks
Stonerfish@aol.com
---------------------------
>From lottsim@aol.com (LOTTSIM)
Subject: ControlList
Date: 15 Feb 1997 04:01:30 GMT
Organization: AOL http://www.aol.com
In one INIT that I've written, I'm "checking" to see if a particular
dialog box comes up. I can't rely on the title (there isn't one), nor on
the refCon. The only things I have to go on are the dimensions and the
type (both obtained via MacsBug).
It would be MUCH easier if I could find out how many different items were
in the dialog box...how would I find this out?
Sincerely,
Alex Rampell
lottsim@aol.com
+++++++++++++++++++++++++++
>From jwwalker@kagi.com (James W. Walker)
Date: Fri, 14 Feb 1997 23:32:54 -0800
Organization: Nisus Software, Inc.
In article <19970215040100.XAA21628@ladder01.news.aol.com>, lottsim@aol.com
(LOTTSIM) wrote:
>It would be MUCH easier if I could find out how many different items were
>in the dialog box...how would I find this out?
Call CountDITL, a toolbox routine.
--
-- Jim Walker <http://members.aol.com/jwwalker/>
+++++++++++++++++++++++++++
>From gherrick@stratos.net
Date: Sun, 16 Feb 1997 11:12:09 -0600
Organization: (none)
In article <19970215040100.XAA21628@ladder01.news.aol.com>, lottsim@aol.com
(LOTTSIM) wrote:
> In one INIT that I've written, I'm "checking" to see if a particular
> dialog box comes up. I can't rely on the title (there isn't one), nor on
> the refCon. The only things I have to go on are the dimensions and the
> type (both obtained via MacsBug).
>
> It would be MUCH easier if I could find out how many different items were
> in the dialog box...how would I find this out?
>
> Sincerely,
>
> Alex Rampell
> lottsim@aol.com
((DialogPeek)theDialog)->items is a handle to the DITL resource which
starts with the number of items (minus 1).
You could also try
((WindowPeek)theDialog)->controlList which is a handle to the start of a
linked list of control records that you can step through. This should help
you to identify not only the number of items, but everything about the
items (e.g. first item is a checkbox with the title "hello", etc.)
I'd suggest you pick up a copy of Inside Macintosh: Mac Toolbox Essentials
for more info on all these things. Or view it in HTML format on apple's web
site.
Regards,
Graham
---------------------------
>From reno@pop.bio.aau.dk (Reno Lindberg)
Subject: Converting postscript to text
Date: Thu, 06 Feb 1997 10:45:51 +0100
Organization: DAIMI, Computer Science Dept. at Aarhus University
I have a huge PS file. I dont want to print all 400 pages out, but I would
like to be able to use it in a text program so I can search for words in
it.
Do any of you know of a program that can convert a postscript file back to text?
reno@pop.bio.aau.dk
+++++++++++++++++++++++++++
>From redgate@tulsa.oklahoma.net (Kirk Kerekes)
Date: Thu, 06 Feb 1997 10:22:04 -0600
Organization: Red Gate Ranch
In article <reno-0602971045520001@klovnen.herb.bio.aau.dk>,
reno@pop.bio.aau.dk (Reno Lindberg) wrote:
. I have a huge PS file. I dont want to print all 400 pages out, but I would
. like to be able to use it in a text program so I can search for words in
. it.
.
"Print" it to the Print2Pict driver, using the text option.
--
Kirk Kerekes
Redgate@Tulsa.oklahoma.net
+++++++++++++++++++++++++++
>From shimberg@poboxes.com (Joel Shimberg)
Date: Thu, 06 Feb 1997 13:21:48 -0500
Organization: Not so much that it constrains me.
In article <reno-0602971045520001@klovnen.herb.bio.aau.dk>,
reno@pop.bio.aau.dk (Reno Lindberg) wrote:
> I have a huge PS file. I dont want to print all 400 pages out, but I would
> like to be able to use it in a text program so I can search for words in
> it.
> Do any of you know of a program that can convert a postscript file back
to text?
I use Snitch to set the creator code to TBB6 and open it in TexEdit, which
has good search/replace capabilities. Since I use Distiller, I don't even
need to return to the original creator, it just opens up.
Hope this helps.
--
(Joel)shimberg@poboxes.com
+++++++++++++++++++++++++++
>From jdipol@logicon.com (John Di Pol)
Date: 7 Feb 1997 17:01:45 GMT
Organization: Logicon RDA
In article <redgate-0602971022050001@aux170.tulsa.oklahoma.net>,
redgate@tulsa.oklahoma.net (Kirk Kerekes) wrote:
>In article <reno-0602971045520001@klovnen.herb.bio.aau.dk>,
>reno@pop.bio.aau.dk (Reno Lindberg) wrote:
>
>. I have a huge PS file. I dont want to print all 400 pages out, but I would
>. like to be able to use it in a text program so I can search for words in
>. it.
>.
>
>"Print" it to the Print2Pict driver, using the text option.
If you have access to Adobe Acrobat Distiller, use Distiller to create an
Acrobat
PDF file. You can then use the free Adobe Acrobat reader to veiw the file,
print selected pages (to any printer, even if it's not PS), and search for
text.
good luck
--jcd
--
John C. Di Pol
Logicon RDA
(310)645-1122 x 356
+++++++++++++++++++++++++++
>From george@mech.seas.upenn.edu ( George Jefferson )
Date: 7 Feb 1997 17:25:26 GMT
Organization: Mechanical Engineering
:. I have a huge PS file. I dont want to print all 400 pages out, but I would
:. like to be able to use it in a text program so I can search for words in
:. it.
:
:"Print" it to the Print2Pict driver, using the text option.
I dont think thats going to work..print from what? If you print
from ghostscript I'm certain it sends only a bit map to the printer
driver.
The best way to do it may actually be it image it then run it through
some OCR program to extract the text..
+++++++++++++++++++++++++++
>From kempkec@multiad.com (Christopher Kempke)
Date: Fri, 07 Feb 1997 13:15:06 -0600
Organization: Multi-Ad Services, Inc.
[Someone] wrote:
> :. I have a huge PS file. I dont want to print all 400 pages out, but I would
> :. like to be able to use it in a text program so I can search for words in
> :. it.
This won't work in all cases, but PostScript often encloses strings in
parenthesis: (Hello World!). If the application that generated the PS
file
was consistent about that, you might be able to write a program to just
extract the user strings.
There's all sorts of things that could break this, but it might work in a
pinch.
[I trimmed the newsgroups, I hope the original poster sees this...]
--Chris
--
Christopher Kempke, kempkec@multiad.com
Sr. Software Architect, Multi-Ad Services Inc.
(I do not speak for my company, profession, or species)
+++++++++++++++++++++++++++
>From shimberg@poboxes.com (Joel Shimberg)
Date: Fri, 07 Feb 1997 14:54:48 -0500
Organization: Not so much that it constrains me.
In article <5dfoi6$dbl@netnews.upenn.edu>, george@mech.seas.upenn.edu (
George Jefferson ) wrote:
> :. I have a huge PS file. I dont want to print all 400 pages out, but I would
> :. like to be able to use it in a text program so I can search for words in
> :. it.
I use Snitch to change file type to TEXT, and creator to TBB6. I then open
up the file in TexEdit+, and use that to search/replace as needed. Acrobat
Distiller reads the resulting text file without any problem, unless I've
screwed it up in modifying it. This is fairly quick, efficient, and cheap.
--
(Joel)shimberg@poboxes.com
+++++++++++++++++++++++++++
>From Jim Land <jland@bigfoot.com>
Date: Fri, 07 Feb 1997 13:45:37 -0600
Organization: (none)
Reno Lindberg wrote:
>
> I have a huge PS file. I dont want to print all 400 pages out, but I would
> like to be able to use it in a text program so I can search for words in
> it.
>
> Do any of you know of a program that can convert a postscript file back to text?
Try pstotext, invented and optimized to do just what you require.
http://www.research.digital.com/SRC/virtualpaper/pstotext.html
for more information. Note that pstotext is included with current
version of gsview, and requires ghostscript to run.
--
Jim Land It's useless to expect rational behavior from
jland@bigfoot.com the people you work with. --Scott Adams
- -----------------------------------------------------------------
+++++++++++++++++++++++++++
>From davep@best.nospam.com (Dave Polaschek)
Date: Fri, 07 Feb 1997 16:53:33 -0600
Organization: Polaschek Publishing
In article <reno-0602971045520001@klovnen.herb.bio.aau.dk>,
reno@pop.bio.aau.dk (Reno Lindberg) wrote:
> I have a huge PS file. I dont want to print all 400 pages out, but I would
> like to be able to use it in a text program so I can search for words in
> it.
>
> Do any of you know of a program that can convert a postscript file back
to text?
I don't know of anything off the top of my head, but one thing you can do
is use the SendPS MPW tool and a PostScript printer to strip out the text
for you. You'll need a small PostScript program which basically redefines
the show operator (and its variants, possibly) to echo the text back to
you (using the = built-in, most likely). Send that program to the printer
first (using an exitserver to make it permanent), then send your file,
and capture the output the comes back from the printer to a text file.
Voila.
If you can't find such a PostScript program in the comp.lang.postscript
archives (where have they moved to, anyhow?) I'm sure someone in that
newsgroup can help.
-DaveP
--
Dave Polaschek - personal: davep@best.com or davep@mn.uswest.net
PGP key and other spiffy things at <http://www.best.com/~davep/>
+++++++++++++++++++++++++++
>From "J. Chapman Flack" <flack@cs.purdue.edu>
Date: Fri, 07 Feb 1997 17:52:09 -0500
Organization: Purdue University
> I dont think thats going to work..print from what? If you print
> from ghostscript I'm certain it sends only a bit map to the printer
> driver.
>
> The best way to do it may actually be it image it then run it through
> some OCR program to extract the text..
Hmm...I'd hate to do that; I just don't hve enough confidence in the
quality of OCR, though it may have improved a lot since I last tried
to OCR much. Intuitively, it seems the text is still closer to text
within the PS file.
Has anybody ever tried something that involves just redefining /show
to accumulate strings in memory somewhere? A redefinition of /moveto
would be in order, and some calculation of position to see which strings
wind up adjacent. Then redefine /showpage to just print (i.e. to
stdout,
not the raster) the accumulated strings, according to position down the
page.
I've never tried to do this, just thinking aloud; this involves some
heavy assumptions, but it wouldn't surprise me if it worked pretty
well for a large class of reasonable page layouts.
-Chap
+++++++++++++++++++++++++++
>From Helge Blischke <H.Blischke@srz-berlin.de>
Date: Sat, 08 Feb 1997 22:07:23 +0100
Organization: (none)
Joel Shimberg wrote:
>
> In article <reno-0602971045520001@klovnen.herb.bio.aau.dk>,
> reno@pop.bio.aau.dk (Reno Lindberg) wrote:
>
> > I have a huge PS file. I dont want to print all 400 pages out, but I would
> > like to be able to use it in a text program so I can search for words in
> > it.
> > Do any of you know of a program that can convert a postscript file back
> to text?
>
> I use Snitch to set the creator code to TBB6 and open it in TexEdit, which
> has good search/replace capabilities. Since I use Distiller, I don't even
> need to return to the original creator, it just opens up.
>
> Hope this helps.
>
> --
> (Joel)shimberg@poboxes.com
You could use Ghostscript's ps2ascii.ps utility.
If the PostScript job you have is not too messed up, you'll
get reasonable results.
Helge Blischke
---------------------------
>From "J. Zack" <wavesoh@earthlink.net>
Subject: CopyBits
Date: Sun, 02 Feb 1997 03:46:20 -0500
Organization: Earthlink Network, Inc.
I'm new to programming.
Does Anybody know if there is a way to get CopyBits to
display different sprites at different frame rates at the same time?
I'm going for realism, not neccesarily speed.
Thanks,
J. Zack
wavesoh@earthlink.net
+++++++++++++++++++++++++++
>From mvanalst@rbi.com (Mark Van Alstine)
Date: Tue, 04 Feb 1997 04:59:53 -0700
Organization: rbi software systems
In article <32F4545C.2C28@earthlink.net>, wavesoh@earthlink.net wrote:
> I'm new to programming.
>
> Does Anybody know if there is a way to get CopyBits to
> display different sprites at different frame rates at the same time?
> I'm going for realism, not neccesarily speed.
CopyBits is frame-rate independant. (Or rather, frame-rate ignorant.) If
one needs to tie sprite blitting to frame rates this would likely be done
via a VBL task to set the approprite flag(s) for each sprite. During the
app's main loop the sprites' flag(s) would be checked and the sprites
blitted accordingly via CopyBits.
Mark
- ------------------------------------------------------------------------------
"Gradually it was disclosed to me that the line separating good and evil passes
not through states, nor between classes, nor between political parties--but
right through every human heart--and all human hearts."
-- Alexander Solzhenitsyn, "The Gulag Archipelago"
- ------------------------------------------------------------------------------
+++++++++++++++++++++++++++
>From "J. Zack" <wavesoh@earthlink.net>
Date: Thu, 06 Feb 1997 01:03:20 -0500
Organization: Earthlink Network, Inc.
Mark Van Alstine wrote:
>
> In article <32F4545C.2C28@earthlink.net>, wavesoh@earthlink.net wrote:
>
> > I'm new to programming.
> >
> > Does Anybody know if there is a way to get CopyBits to
> > display different sprites at different frame rates at the same time?
> > I'm going for realism, not neccesarily speed.
>
> CopyBits is frame-rate independant. (Or rather, frame-rate ignorant.) If
> one needs to tie sprite blitting to frame rates this would likely be done
> via a VBL task to set the approprite flag(s) for each sprite. During the
> app's main loop the sprites' flag(s) would be checked and the sprites
> blitted accordingly via CopyBits.
>
> Mark
>
> --------------------------------------------------------------------------------
> "Gradually it was disclosed to me that the line separating good and evil passes
> not through states, nor between classes, nor between political parties--but
> right through every human heart--and all human hearts."
>
> -- Alexander Solzhenitsyn, "The Gulag Archipelago"
> --------------------------------------------------------------------------------
Since I posted the above message, I've discovered SpriteWorld located at
http://members.aol.com/SpriteWld2/index.html and it seems to be very easy to use.
I'm sorry to say I don't understand what your talking about in your answer -
maybe someday, obviously I'm very new to programming :)
Thanks!
Thanks,
J. Zack
wavesoh@earthlink.net
(I have to think of a neat quote to put at the bottom of my postings like
everybody else)
+++++++++++++++++++++++++++
>From Tom Rockwell <tjr0868@ritvax.isc.rit.edu>
Date: Fri, 07 Feb 1997 14:02:59 +0000
Organization: Sudden Death
J. Zack wrote:
>
> I'm new to programming.
>
> Does Anybody know if there is a way to get CopyBits to
> display different sprites at different frame rates at the same time?
> I'm going for realism, not neccesarily speed.
>
> Thanks,
> J. Zack
> wavesoh@earthlink.net
I would guess you'd have to do it manually. If, for example (I'll use a
nice even one) sprite X moves at 5 fps and sprite Y moves at 10 fps then
call CopyBits() to move Y, then both X and Y, then just Y, then both X
and Y, etc. If one moves at 13 and the other at 15 then it probably
won't be smooth whatever you do.
->Later.....Spice
---------------------------
>From rspence3@osf1.gmu.edu (Rspence3)
Subject: Disable shutdown key?
Date: Sun, 26 Jan 1997 14:30:37 -0500
Organization: George Mason University, Fairfax, Virginia, USA
Is there an easy way to disable the keyboard's shutdown key from within an
app? I have written a few C programs to entertain the preschoolers in my
house, but now they know that if they hit that key, I have to come running
over to hit cancel. This is much more entertaining than anything that I
can program the computer to do. The programs don't respond to shutdown
events, so it doesn't shut down the computer, but if it happens enough,
the computer eventually crashes. Any other parental programmers out
there?
Cheers, Rick
+++++++++++++++++++++++++++
>From "Seth Hill" <ferris@proaxis.com>
Date: 31 Jan 97 21:49:59 -0800
Organization: ProAxis Communications, Inc.
>Is there an easy way to disable the keyboard's shutdown key from within an
>app? I have written a few C programs to entertain the preschoolers in my
>house, but now they know that if they hit that key, I have to come running
>over to hit cancel. This is much more entertaining than anything that I
>can program the computer to do. The programs don't respond to shutdown
>events, so it doesn't shut down the computer, but if it happens enough,
>the computer eventually crashes. Any other parental programmers out
>there?
>
>Cheers, Rick
ftp to your favorite info-mac mirror and get this file:
info-mac/cfg/no-power-off-key-12.hqx
It's a piece of Apple Sample code by Brian Bechtel <blob@apple.com> that
(you guessed it) deactivates the power key. It's an extension but the code
is well commented and it's not too difficult to make it work from inside an
application.
--
Seth Hill
+++++++++++++++++++++++++++
>From rspence3@osf1.gmu.edu (Rspence3)
Date: Sun, 02 Feb 1997 15:32:09 -0500
Organization: George Mason University, Fairfax, Virginia, USA
>
> ftp to your favorite info-mac mirror and get this file:
> info-mac/cfg/no-power-off-key-12.hqx
>
> It's a piece of Apple Sample code by Brian Bechtel <blob@apple.com> that
> (you guessed it) deactivates the power key. It's an extension but the code
> is well commented and it's not too difficult to make it work from inside an
> application.
>
> --
> Seth Hill
Just in case anyone wants to know:
Seth's suggestion worked perfectly. It took me about two minutes, and
three cut and pastes to add this routine to MyInitRoutine();. Now if I
could get some code which protects my keyboard from peanut butter and
jelly, I would really be in business!
Cheers, Rick
+++++++++++++++++++++++++++
>From "Seth Hill" <ferris@proaxis.com>
Date: 8 Feb 97 00:05:47 -0800
Organization: ProAxis Communications, Inc.
> Now if I could get some code which protects my keyboard from peanut
> butter and jelly, I would really be in business!
>
>Cheers, Rick
>
That's the real trick. :-)
--
Seth Hill
---------------------------
>From gutman819@aol.com (Gutman 819)
Subject: DrawPicture
Date: 1 Feb 1997 21:32:15 GMT
Organization: AOL http://www.aol.com
Is there any way that I can use the DrawPicture() call to draw a circular
picture to the screen without having a big white square around it? If
not, how could I draw a circular picture to the screen?
+++++++++++++++++++++++++++
>From Erin O Keenan <lostpoet@pipeline.com>
Date: Sat, 01 Feb 1997 17:26:33 -0800
Organization: Fission
Gutman 819 wrote:
>
> Is there any way that I can use the DrawPicture() call to draw a circular
> picture to the screen without having a big white square around it? If
> not, how could I draw a circular picture to the screen?
Well, this is only going to work if you have SuperPaint, but here goes:
Paste your picture into SuperPaint as a draw object. Now, set the ink to
"Transparent Background" (or something like that) and copy the
picture... The white border is no longer part of the picture (and won't
draw), so just paste back into your resources... Draw as normal.
Love, Peace, and stuff,
Erin
+++++++++++++++++++++++++++
>From "Ron W. Miller" <ronm@portsoft.com>
Date: Sat, 01 Feb 1997 16:51:00 +0000
Organization: Portland Software, Inc.
>
> Is there any way that I can use the DrawPicture() call to draw a circular
> picture to the screen without having a big white square around it? If
> not, how could I draw a circular picture to the screen?
I don't think that you can do it with DrawPicture. Using CopyMask to
blit your bitmap to the screen should do this for you quite nicely.
CopyMask is somewhat slow though, so it won't work as well for a bigger
picture.
Ron W. Miller
- ---------------------------------+
Ron W. Miller +
Senior Software Engineer +
Portland Software Inc. +
Portland, Oregon USA +
<mailto:ronm@portsoft.com> +
<http:www.portsoft.com> +
- ---------------------------------+
+++++++++++++++++++++++++++
>From trickys@ix.netcom.com (Tricky S)
Date: Sat, 01 Feb 1997 22:07:34 -0600
Organization: Tricky S Software Factory
All you need to do is to make sure that your picture's copy mode is set to
anything that has transparent white pixels, such as 'srcOr' copy mode.
This is probably what SuperPaint is doing. Deneba's Canvas lets you select
from several copy modes.
In article <32F3ED36.2729@pipeline.com>, lostpoet@pipeline.com wrote:
> Gutman 819 wrote:
> >
> > Is there any way that I can use the DrawPicture() call to draw a circular
> > picture to the screen without having a big white square around it? If
> > not, how could I draw a circular picture to the screen?
>
> Well, this is only going to work if you have SuperPaint, but here goes:
>
> Paste your picture into SuperPaint as a draw object. Now, set the ink to
> "Transparent Background" (or something like that) and copy the
> picture... The white border is no longer part of the picture (and won't
> draw), so just paste back into your resources... Draw as normal.
>
> Love, Peace, and stuff,
> Erin
_____________
\ ____________\
|| _________ | Stefan "Tricky S" Sinclair
|| /@--------\ | <mailto:trickys@ix.netcom.com>
|| | | | <http://cse.unl.edu/~sinclair/SpriteFight/sf2k.html>
|| | | |
|| \_________/ | The label said "Requires Windows95
|| ____ | or better" so I bought a Mac.
|| o Mac |
\|_____________|
\|___________|
+++++++++++++++++++++++++++
>From ingemar@lysator.liu.se (Ingemar Ragnemalm)
Date: 2 Feb 1997 08:38:44 GMT
Organization: Linkˆping University, Sweden
gutman819@aol.com (Gutman 819) writes:
>Is there any way that I can use the DrawPicture() call to draw a circular
>picture to the screen without having a big white square around it? If
>not, how could I draw a circular picture to the screen?
That depends on your drawing program. Some drawing programs are stupid and
gives you that white borders, and some do it right.
--
Ingemar Ragnemalm
E-mail address: ingemar@lysator.liu.se
Shared libraries/DLLs are bad for your health.
+++++++++++++++++++++++++++
>From heaney@crl.com (John S. Heaney)
Date: 3 Feb 1997 15:09:00 -0800
Organization: CRL Dialup Internet Access (415) 705-6060 [Login: guest]
In article <19970201213200.QAA10867@ladder01.news.aol.com>,
Gutman 819 <gutman819@aol.com> wrote:
>Is there any way that I can use the DrawPicture() call to draw a circular
>picture to the screen without having a big white square around it? If
>not, how could I draw a circular picture to the screen?
The short answer is yes, DrawPicture can draw a picture into any shape
you want.
A PictureHandle drawn with DrawPicture is not merely a bitmap or a
pixmap; it's actually a series of drawing commands, of which a bitmap or
pixmap may be just one element. A PictureHandle is created by calling
OpenPicture, issueing some number of QuickDraw commands and then calling
ClosePicture. The commands, and the data associated with the commands,
are saved in the PictureHandle. The commands are then executed
sequencially by DrawPicture.
There are two ways (that I can think of) that a Picture can draw an image
into a non-rectangular area. One way is to use a background color and draw
with the srcOr mode. The background colored pixels will not be drawn. This
is like a blue screen type thing in movie parlance.
The other way is to punch a hole in the screen with a 1-bit mask and then
draw into the hole with the srcOr mode. The benefit of this method is
that you can have background colored pixels as part of your image. This
is the way icons are drawn. Check out 'cicn' resources.
The trick then is to use a tool that will allow you to create a PICT
resource or picture file that will have the correct drawing commands.
Most drawing and screen capture programs save only bitmaps or pixmaps to
the picture. But there are some that do more.
I use Canvas. Canvas allows you to set up the QuickDraw commands the way
you want. It also allows you to create a separate bitmap mask and color
image in the same file as separate objects. You can then Align them and
Group them and copy them as a single PICT resource, which you can then
paste into a file with a resource editor. It's pretty compilicated, but it
works.
Also, Resorcerer has a PICT resource de/compiler. It breaks a PICT
resource down into its components. You can then edit them. In your case,
you may be able to open your current image and change the transfer mode
and be done. Sometimes it's that easy.
Sometimes it isn't. :)
Good luck.
--
John Heaney Time flies whether you're having fun or not.
heaney@crl.com
+++++++++++++++++++++++++++
>From refiegle@mail.delcoelect.com (Richard E. Fiegle)
Date: Wed, 05 Feb 1997 11:37:16 -0600
Organization: Delco Electronics
In article <19970201213200.QAA10867@ladder01.news.aol.com>,
gutman819@aol.com (Gutman 819) wrote:
> Is there any way that I can use the DrawPicture() call to draw a circular
> picture to the screen without having a big white square around it? If
> not, how could I draw a circular picture to the screen?
One way would be to set the ClipRgn to the circular region (if you know
how to calculate it before it's actually drawn :-), then call DrawPicture(),
then restore the ClipRgn.
--
Richard E. Fiegle
Opinions expressed are mine, not necessarily those of my employer
+++++++++++++++++++++++++++
>From Shapiro@AOL.com (Eric Shapiro)
Date: 7 Feb 1997 00:18:59 GMT
Organization: Relium Corp.
In article <19970201213200.QAA10867@ladder01.news.aol.com>,
gutman819@aol.com (Gutman 819) wrote:
> Is there any way that I can use the DrawPicture() call to draw a circular
> picture to the screen without having a big white square around it? If
> not, how could I draw a circular picture to the screen?
If the PICT has high-level drawing calls rather than a bitmap,
then you won't get the ugly white rectangle.
Something like:
OpenPicture();
SetRect( &r, 20, 20, 50 50 );
FrameOval( &r );
ClosePicture();
// other stuff here...
DrawPicture( myPict );
You will have to create the picture yourself or by using a drawing
tool (like MacDraw) rather than a painting tool (like PhotoShop).
-Eric
--
Eric Shapiro
Relium Corp.
shapiro@aol.com
---------------------------
>From John Stiles <jstiles@uclink4.berkeley.edu>
Subject: Embedding a QuickTime into an app
Date: Mon, 03 Feb 1997 02:51:17 -0600
Organization: Deja News Usenet Posting Service
I'm looking to stick a little QuickTime movie into my about box. Nothing
big, just a 50K looping ditty. Currently, however, the only way I can
figure to open a QuickTime movie is in its own separate file. This poses a
problem, as the application should be self-contained.
It would be perfect if I could do something like flatten the movie, stick
it into a resource, and load it from there. Is such a thing possible? I
suppose I could load the resource, quickly copy its contents into a
temporary file, and tell QuickTime to open that, but that's a gigantic
kludge--is there any more elegant way?
Thanks for any help.
*Stiles
PS How do you tell QuickTime to do looping? Currently, I just say in my
loop:
if( IsMovieDone( logoMovie ) ) GoToBeginningOfMovie( logoMovie );
And that works fine, but I was under the impression that there was a
cleaner way.
*Stiles
- -----------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
+++++++++++++++++++++++++++
>From SouthSide@kagi.com (Bob Bradley)
Date: 4 Feb 1997 05:53:39 GMT
Organization: SPC
In article <854959050.13887@dejanews.com>, jstiles@uclink4.berkeley.edu wrote:
> I'm looking to stick a little QuickTime movie into my about box. Nothing
> big, just a 50K looping ditty. Currently, however, the only way I can
> figure to open a QuickTime movie is in its own separate file. This poses a
> problem, as the application should be self-contained.
>
> It would be perfect if I could do something like flatten the movie, stick
> it into a resource, and load it from there. Is such a thing possible?
You can use NewMovieFromHandle.
+++++++++++++++++++++++++++
>From Online@MacTech.com ( nick.c @MT )
Date: Tue, 04 Feb 1997 13:57:54 -0800
Organization: MacTech Magazine
jstiles@uclink4.berkeley.edu wrote:
>PS How do you tell QuickTime to do looping? Currently, I just say in my
>loop:
>if( IsMovieDone( logoMovie ) ) GoToBeginningOfMovie( logoMovie );
>
>And that works fine, but I was under the impression that there was a
>cleaner way.
You can use MCDoAction to tell the movie controller to loop.
Like this:
MCDoAction( myController, mcActionSetLooping, (Ptr)true );
BTW, Dan Sydow wrote a whole chapter about QuickTime movie
implementation in his _Graphics and Sound Programming_
book (ISBN: 1-55851-442-2), including movie looping etc.
If you're interested in doing stuff with QuickTime, the
book is really something to put on your shopping list.
____Nicholas C. DeMello, Ph.D.___________________________________________
"MacTech Online"--MacTech Magazine, for Mac OS Programmers and Developers
http://www.MacTech.com/
_/ _/ _/ _/_/_/ _/ _/
Chemistry: Nick@chem.UCLA.edu _/_/ _/ _/ _/ _/ _/_/_/
MacTech: Online@MacTech.com _/ _/_/ _/ _/ _/ _/
http://www.chem.ucla.edu/~nick/ _/ _/ _/_/_/ _/ _/
+++++++++++++++++++++++++++
>From David Reiss <reiss@astro.washington.edu>
Date: Tue, 04 Feb 1997 14:54:52 -0800
Organization: http://www.astro.washington.edu/reiss
I was going to post this exact same question. I do the same thing but I
get
a 'jump' when it re-starts the movie. Is there a clean way to do this
if you're
not using a movie controller?
-David
nick.c @MT wrote:
>
> jstiles@uclink4.berkeley.edu wrote:
>
> >PS How do you tell QuickTime to do looping? Currently, I just say in my
> >loop:
> >if( IsMovieDone( logoMovie ) ) GoToBeginningOfMovie( logoMovie );
> >
> >And that works fine, but I was under the impression that there was a
> >cleaner way.
>
> You can use MCDoAction to tell the movie controller to loop.
> Like this:
>
> MCDoAction( myController, mcActionSetLooping, (Ptr)true );
>
> BTW, Dan Sydow wrote a whole chapter about QuickTime movie
> implementation in his _Graphics and Sound Programming_
> book (ISBN: 1-55851-442-2), including movie looping etc.
> If you're interested in doing stuff with QuickTime, the
> book is really something to put on your shopping list.
>
> ____Nicholas C. DeMello, Ph.D.___________________________________________
> "MacTech Online"--MacTech Magazine, for Mac OS Programmers and Developers
> http://www.MacTech.com/
> _/ _/ _/ _/_/_/ _/ _/
> Chemistry: Nick@chem.UCLA.edu _/_/ _/ _/ _/ _/ _/_/_/
> MacTech: Online@MacTech.com _/ _/_/ _/ _/ _/ _/
> http://www.chem.ucla.edu/~nick/ _/ _/ _/_/_/ _/ _/
+++++++++++++++++++++++++++
>From Online@MacTech.com ( nick.c @MT )
Date: Tue, 04 Feb 1997 19:44:08 -0800
Organization: MacTech Magazine
jstiles@uclink4.berkeley.edu wrote:
>I'm looking to stick a little QuickTime movie into my about box. Nothing
>big, just a 50K looping ditty. Currently, however, the only way I can
>figure to open a QuickTime movie is in its own separate file. This poses a
>problem, as the application should be self-contained.
>
>It would be perfect if I could do something like flatten the movie, stick
>it into a resource, and load it from there. Is such a thing possible?
// To create a movie resource, use your NewMovieFromFile() routine to get
// a movie object: myMovie
myErr = NewMovieFromFile ( myMovie, resRefNum, resId, resName,
newMovieFlags, nil);
// Then use PutMovieIntoHandle to put that object into a resource file.
myErr = PutMovieIntoHandle (myMovie, myHandle);
// Then copy whatever movies you've made from this resource file into your
// apps resource fork with Resorcerer or ResEdit. When you want to
// play the movie use:
myErr = NewMovieFromHandle (myMovie, myHandle, newMovieActive, nil);
Hope this helps,
____Nicholas C. DeMello, Ph.D.___________________________________________
"MacTech Online"--MacTech Magazine, for Mac OS Programmers and Developers
http://www.MacTech.com/
_/ _/ _/ _/_/_/ _/ _/
Chemistry: Nick@chem.UCLA.edu _/_/ _/ _/ _/ _/ _/_/_/
MacTech: Online@MacTech.com _/ _/_/ _/ _/ _/ _/
http://www.chem.ucla.edu/~nick/ _/ _/ _/_/_/ _/ _/
+++++++++++++++++++++++++++
>From "John Dalgliesh" <s2191331@cse.unsw.edu.au>
Date: 6 Feb 97 13:45:22 +1000
Organization: University of New South Wales
>I was going to post this exact same question. I do the same thing but I
>get
>a 'jump' when it re-starts the movie. Is there a clean way to do this
>if you're
>not using a movie controller?
Yep. The following line works for me...
SetTimeBaseFlags(GetMovieTimeBase(theMovie), loopTimeBase);
{P^/
---------------------------
>From bwood@uiuc.edu (Brett Wood)
Subject: How do I use BitMapToRegion?
Date: Thu, 06 Feb 1997 01:51:24 -0500
Organization: University of Illinois
Here's the scenario: I have an offscreen graphics world which contains an image
generated by using SetCPixel for whichever pixels are part of the image. Any
pixels within the bounds of the world which are a part of the "background" have
had nothing done to them since the world's creation. Now I want to copy this
image onto another image, while preserving the background. I create a new
region and pass this region to BitMapToRegion, using the portBits of the
offscreen world from which I'll be copying. Then I use this region as the mask
region in the call to CopyBits. I thought it was pretty straightforward, but
using this procedure, I don't see any of the newly copied picture. (I also
tried inverting the region, just in case, but that didn't work either.) When I
use no mask region, everthing works fine (except, of course, the remainder of
the rectangle is pure white, rather than having the original background), so I
know the only problem is with generating the mask region.
In case you had trouble following that, here's a code snippet:
RgnHandle mask = NewRgn();
BitMapToRegion(mask, &((GrafPtr)picGWorld)->portBits);
//InvertRgn(mask); (tried with and without this)
CopyBits(&((GrafPtr)picGWorld)->portBits, &port->portBits,
&srcRect, &destRect, srcCopy, mask);
Apparently I do not understand how to use BitMapToRegion, and as the IM
documention (in Basic Quickdraw) was not very helpful, I was hoping someone
could give me a brief explanation as to why the above technique doesn't work.
TIA,
Brett Wood
+++++++++++++++++++++++++++
>From Carl R. Osterwald <carl_osterwald@nrel.SPAM-NYET.gov>
Date: 6 Feb 1997 17:31:26 GMT
Organization: National Renewable Energy Laboratory
In article <bwood-0602970151240001@kyoto-11.slip.uiuc.edu> Brett Wood,
bwood@uiuc.edu writes:
>Apparently I do not understand how to use BitMapToRegion, and as the IM
>documention (in Basic Quickdraw) was not very helpful, I was hoping
>someone could give me a brief explanation as to why the above technique
>doesn't work.
The first thing to remember about BitMapToRegion is that it works on
either B&W BitMaps or 1-bit PixMaps. If your GWorld has a depth that
is greater than 1, you'll have to work around this.
>From New Inside Mac: Imaging with Quickdraw:
BitMapToRegion
You can use the BitMapToRegion function to convert a bitmap or pixel map
to a region.
FUNCTION BitMapToRegion (region: RgnHandle; bMap: BitMap): OSErr;
region A handle to a region to hold the converted BitMap or PixMap
record.
bMap A BitMap or PixMap record.
DESCRIPTION
The BitMapToRegion function converts a given BitMap or PixMap record to
a region. You would generally use this region later for drawing
operations. The region parameter must be a valid region handle created
with the NewRgn function (described in the chapter ≥QuickDraw Drawing≤).
The old region contents are lost.
The bMap parameter may be either a BitMap or PixMap record. If you pass
a PixMap record, its pixel depth must be 1.
RESULT CODES
pixmapTooDeepErr ≠148 Pixel map is deeper than 1 bit per pixel
rgnTooBigErr ≠500 Bitmap would convert to a region greater than 64
KB
+++++++++++++++++++++++++++
>From hpetsch@island.net (Herb Petschauer)
Date: Thu, 06 Feb 1997 10:08:20 -0800
Organization: none
In article <bwood-0602970151240001@kyoto-11.slip.uiuc.edu>, bwood@uiuc.edu
(Brett Wood) wrote:
> Here's the scenario: I have an offscreen graphics world which contains
an image
...
>
> RgnHandle mask = NewRgn();
> BitMapToRegion(mask, &((GrafPtr)picGWorld)->portBits);
> //InvertRgn(mask); (tried with and without this)
> CopyBits(&((GrafPtr)picGWorld)->portBits, &port->portBits,
> &srcRect, &destRect, srcCopy, mask);
>
> Apparently I do not understand how to use BitMapToRegion, and as the IM
BitMapToRegion() requires a bitmap, it looks to me as if you are using a
colour GWorld. If even your colour offscreen image only uses 2 colours
(black and white) BitMapToRegion will fail.
BitMapToRegion() returns an OSErr, confirm that it is not returning "noErr"
in your case. I believe that an error of -148 indicates a
pixMapTooDeepError.
Hope this helps,
H.
--
No male in his family has lived longer than 45. He eats Fast Food, five
times a day. He hasn't left his armchair in 2 months. He is 45 kg.
overweight - and climbing. If you listen closely, you can hear his
arteries clogging.
No Fear (TM).
hpetsch@island.net ;-)
+++++++++++++++++++++++++++
>From matt@colorpar.com (Matt Gieselman)
Date: Thu, 06 Feb 1997 10:40:00 -0800
Organization: The Color Partnership
In article <bwood-0602970151240001@kyoto-11.slip.uiuc.edu>, bwood@uiuc.edu
(Brett Wood) wrote:
Brett,
Looking at the following code:
> RgnHandle mask = NewRgn();
> BitMapToRegion(mask, &((GrafPtr)picGWorld)->portBits);
> //InvertRgn(mask); (tried with and without this)
> CopyBits(&((GrafPtr)picGWorld)->portBits, &port->portBits,
> &srcRect, &destRect, srcCopy, mask);
I would guess that your picGWorld is color and not black and
white. BitMapToRegion expects the gWorld to be 1 bit deep.
You can check this by declaring a variable err of type short
and making the call like this:
err = BitMapToRegion
if ( err == pixMapTooDeepErr )
SysBeep( 1 );
This will let you know if the picGWorld is what the region
expects. Also you should call EmptyRgn to see if the region
has nothing in it.
Probably what you need to do is allocate a GWorld that is
1 bit deep, draw your pict into that GWorld and then use
that in the BitMapToRegion call.
Hope this helps,
Matt
- ------------------------------------------------------------
Matt Gieselman
Software Engineer and Juggler
The Color Partnership
matt@colorpar.com
www.colorpar.com
- -----------------------------------------------------------
+++++++++++++++++++++++++++
>From bwood@uiuc.edu (Brett Wood)
Date: Thu, 06 Feb 1997 13:41:03 -0500
Organization: University of Illinois
> I would guess that your picGWorld is color and not black and
> white. BitMapToRegion expects the gWorld to be 1 bit deep.
>
> You can check this by declaring a variable err of type short
> and making the call like this:
>
> err = BitMapToRegion
> if ( err == pixMapTooDeepErr )
> SysBeep( 1 );
>
> This will let you know if the picGWorld is what the region
> expects. Also you should call EmptyRgn to see if the region
> has nothing in it.
>
> Probably what you need to do is allocate a GWorld that is
> 1 bit deep, draw your pict into that GWorld and then use
> that in the BitMapToRegion call.
>
> Hope this helps,
> Matt
Yep, this was precisely my problem. Thanks to all who responded.
Brett
+++++++++++++++++++++++++++
>From stone@enetis.net (Kevin and Brian Stone)
Date: 6 Feb 1997 12:25:45 -0700
Organization: E-Net Information Services (605-341-ENET)
: > Here's the scenario: I have an offscreen graphics world which contains
: an image
: ...
: >
: > RgnHandle mask = NewRgn();
: > BitMapToRegion(mask, &((GrafPtr)picGWorld)->portBits);
: > //InvertRgn(mask); (tried with and without this)
: > CopyBits(&((GrafPtr)picGWorld)->portBits, &port->portBits,
: > &srcRect, &destRect, srcCopy, mask);
: >
: > Apparently I do not understand how to use BitMapToRegion, and as the IM
: BitMapToRegion() requires a bitmap, it looks to me as if you are using a
: colour GWorld. If even your colour offscreen image only uses 2 colours
: (black and white) BitMapToRegion will fail.
You CAN use a GWorld pixmap, but you must make the pixelDepth 1-bit...
NewGWorld(&myMaskGWorld, 1, &maskRect, nil, nil, nil);
You should also be aware of the regions size, memory wise. Regions can
not be larger than 32k. It's quite difficult to make a region this
large, but if you think your regions may be exceeding 32k, then you can
use GetHandleSize() after creating the region to see how large it
actualy is.
Sincerly,
Brian Stone
programmer
Stone Entertainment
stone@enetis.net
http://www.enetis.net/~stone
+++++++++++++++++++++++++++
>From Wordman <wordman@pobox.com>
Date: Wed, 12 Feb 1997 10:59:19 -0500
Organization: Flashpoint, Inc.
Brett Wood wrote:
>
> Here's the scenario: I have an offscreen graphics world which contains an image
> generated by using SetCPixel for whichever pixels are part of the image. Any
> pixels within the bounds of the world which are a part of the "background" have
> had nothing done to them since the world's creation. Now I want to copy this
> image onto another image, while preserving the background. I create a new
It sounds like you are trying to draw with a transparent color. That is,
take an image and transfer every pixel of it to another picture except
those pixels that are the color of the background. There is an easier
way to do this, the gist of which is this:
RGBBackColor( &theBackgroundColor );
// Copy the pixels using Apple's recommended port coersion.
CopyBits( &((GrafPtr)theSrcPortPtr)->portBits,
&((GrafPtr)theDstPortPtr)->portBits,
&theSrcRect,&theDestRect,transparent,nil );
The key is the transparent mode constant. This should be way faster than
using SetCPixel. If you really need to use the mask, use the bit
transfers that take masks: CopyMask and CopyDeepMask. These routines are
like CopyBits, but they take an extra bitmap parameter as a mask. All
the pixels from the source are blown through this mask onto the
destination.
Wordman
http://pobox.com/~wordman
---------------------------
>From T.J. Patterson <monoply@primenet.com>
Subject: Images In "SimpleText"?..
Date: 10 Feb 1997 04:14:01 -0700
Organization: Primenet (602)416-7000
I wasn't sure if this was the place to post this question, but I need
help.
I have previously seen software companies, and others, include images and
order forms in SimpleText documents as well as the normal text.
I tried to find out how by playing with it, but can't make it happen. I
can "open" a PICT image in a SimpleText window, but then can't type a
document in it, and can't import the image into a document either.
Does anyone have any ideas on how I can make this happen? Thanks for any
help :)
T.J. Patterson
monoply@primenet.com
+++++++++++++++++++++++++++
>From Wulf Hofbauer <wh@echo.chem.tu-berlin.de>
Date: Mon, 10 Feb 1997 18:15:24 +0100
Organization: Max-Volmer-Institut, TU Berlin
T.J. Patterson wrote:
I have previously seen software companies, and others, include images
and
> order forms in SimpleText documents as well as the normal text.
>
> I tried to find out how by playing with it, but can't make it happen. I
> can "open" a PICT image in a SimpleText window, but then can't type a
> document in it, and can't import the image into a document either.
Copy the PICT resources you want to include into the resource fork. They
should be numbered consecutively, starting with ID=1000.
The pictures will be displayed by SimpleText wherever there's a sticky
space (Cmd-space) character in the text. Note that you'll have to enter
some blank lines because no room is reserved for the pictures.
As for making the file read-only, change the file type from "TEXT" to
"ttro" (which means TeachText Read Only).
- Wulf
--
________________________________________________________
! Dipl. Phys. Wulf Hofbauer (wh@echo.chem.tu-berlin.de) !
! Max-Volmer-Institut Technische Universitaet Berlin !
! Strasse des 17. Juni 135 10623 Berlin Germany !
!________________________________________________________!
+++++++++++++++++++++++++++
>From bitzm@apple.com (Mike Bitz)
Date: Mon, 10 Feb 1997 13:13:36 -0700
Organization: Apple Computer, Inc.
> I have previously seen software companies, and others, include images and
> order forms in SimpleText documents as well as the normal text.
>...
> Does anyone have any ideas on how I can make this happen? Thanks for any
> help :)
Check out Technote 1005 which is available at:
<http://17.126.23.20/dev/technotes/tn/tn1005.html>
-Mike
+++++++++++++++++++++++++++
>From dsample@synapse.net (Don Sample)
Date: Mon, 10 Feb 1997 15:42:10 -0500
Organization: DASoftware
In article <5dmvtp$qgj@nnrp1.news.primenet.com>, T.J. Patterson
<monoply@primenet.com> wrote:
>I wasn't sure if this was the place to post this question, but I need
>help.
>
>I have previously seen software companies, and others, include images and
>order forms in SimpleText documents as well as the normal text.
>
>I tried to find out how by playing with it, but can't make it happen. I
>can "open" a PICT image in a SimpleText window, but then can't type a
>document in it, and can't import the image into a document either.
>
>Does anyone have any ideas on how I can make this happen? Thanks for any
>help :)
>
>T.J. Patterson
>monoply@primenet.com
IIRC you put a non-breaking space character (option-space) into your text
followed by enough return characters to make a hole for the image you want
to display, and then put the images into the resource fork as a series of
PICT resources. I do not recall whether or not there was any special
numbering you had to do for the resources. Someone else may know, or you
can experiment.
--
Don Sample |
dsample@bix.com | Quando Omni Flunkus Moritati
dsample@synapse.net |
http://www.synapse.net/~dsample/ |
+++++++++++++++++++++++++++
>From stone@enetis.net (Kevin and Brian Stone)
Date: 10 Feb 1997 18:19:00 -0700
Organization: E-Net Information Services (605-341-ENET)
: > I have previously seen software companies, and others, include images and
: > order forms in SimpleText documents as well as the normal text.
: >...
: > Does anyone have any ideas on how I can make this happen? Thanks for any
: > help :)
It's very simple.
Press option-space where ever you want a picture. Save the file and
then open it up in ResEdit, or your favorite resource editor. Copy in
your pictures in the order you want them to display in the document,
and change their ID's to 1000, 1001, 1002, etc.
If you want to make a simpletext document read-only, open the document
up in a resouce editor and chage the file Type from 'TEXT' to 'ttro'.
This will also make it use the standard "newspaper" icon. :)
Sincerly,
Brian Stone
programmer
Stone Entertainment
stone@enetis.net
http://www.enetis.net/~stone
+++++++++++++++++++++++++++
>From T.J. Patterson <monoply@primenet.com>
Date: 14 Feb 1997 03:07:02 -0700
Organization: Primenet (602)416-7000
Wulf Hofbauer <wh@echo.chem.tu-berlin.de> wrote:
: Copy the PICT resources you want to include into the resource fork. They
: should be numbered consecutively, starting with ID=1000.
: The pictures will be displayed by SimpleText wherever there's a sticky
: space (Cmd-space) character in the text. Note that you'll have to enter
: some blank lines because no room is reserved for the pictures.
: As for making the file read-only, change the file type from "TEXT" to
: "ttro" (which means TeachText Read Only).
The man knows his stuff! I tried this and it works great. I now have
snazzy SimpleText documents with colorfull PICT's, etc..
Now, how 'bout adding sound resources to 'em =)
T.J. Patterson
--------------------------------------------
Monopoly Management
monoply@primenet.com
http://www.primenet.com/~monoply/credit.html
PO Box 37253
Phoenix, AZ 85069-7253
(800) 484-6302 ext: 0109
--------------------------------------------
---------------------------
>From "Eduardo Suastegui" <eduardo@quests.com>
Subject: MRJ and stand-alone Java applications
Date: Fri, 31 Jan 1997 15:42:23 +0000
Organization: Quest Software
Is it possible to run a stand-alone Java application with MRJ (Applet
Runner)?
I have not been able to open anything with the Applet Runner other than HTML
files.
Please respond via email to eduardo@quests.com
Thanks in advance,
Ed Suastegui
+++++++++++++++++++++++++++
>From Bob Foster <bobfoster@worldnet.att.net>
Date: Sat, 01 Feb 1997 00:24:38 +0000
Organization: Symantec Corp.
Eduardo Suastegui wrote:
>
> Is it possible to run a stand-alone Java application with MRJ (Applet
> Runner)?
> I have not been able to open anything with the Applet Runner other than HTML
> files.
>
> Please respond via email to eduardo@quests.com
Download the MRJ SDK and use JRunner.
Bob
+++++++++++++++++++++++++++
>From uzs90z@uni-bonn.de (Michael Schuerig)
Date: Sat, 1 Feb 1997 12:09:39 +0100
Organization: RHRZ - University of Bonn (Germany)
Eduardo Suastegui <eduardo@quests.com> wrote:
> Is it possible to run a stand-alone Java application with MRJ (Applet
> Runner)?
> I have not been able to open anything with the Applet Runner other than HTML
> files.
You need to get the MRJ SDK for that. <http://applejava.apple.com/>.
Michael
- -
Michael Schuerig
mailto:uzs90z@uni-bonn.de
http://www.uni-bonn.de/~uzs90z/
+++++++++++++++++++++++++++
>From pmth02jc@umassd.edu (Jim Correia)
Date: Sat, 01 Feb 1997 01:53:23 -0500
Organization: University of Massachusetts Dartmouth
In article <eduardo-3101971542230001@192.77.210.102>, "Eduardo Suastegui"
<eduardo@quests.com> wrote:
>Is it possible to run a stand-alone Java application with MRJ (Applet
>Runner)?
>I have not been able to open anything with the Applet Runner other than HTML
>files.
Get the 1.0b4 sdk. It lets you build standalone, double-clickable applications.
Jim
--
--
Jim Correia There is probably a cow in a
pmth02jc@umassd.edu field somewhere saying moo.
http://tango.mth.umassd.edu/correia/
+++++++++++++++++++++++++++
>From "Eduardo Suastegui" <esuastegui@msn.com>
Date: Sat, 01 Feb 1997 10:23:12 -0800
Organization: My Happy Home
Michael Schuerig <uzs90z@uni-bonn.de> wrote in article
<1997020112093920404@rhrz-ts2-p12.rhrz.uni-bonn.de>...
> You need to get the MRJ SDK for that. <http://applejava.apple.com/>.
I have downloaded MRJ, and I have tried to run .class files. But as I said
in my original message,
all the Apple Applet Runner lets me do is open HTML files. I am used to
applications on the Sun
and on Windows that let run an applet as a stand-alone application from the
command line. For
example:
# jview MyApplet.class
Is there an equivalent way to do this using MRJ?
Regards,
Ed Suastegui
+++++++++++++++++++++++++++
>From Bob Foster <bobfoster@worldnet.att.net>
Date: Sat, 01 Feb 1997 20:57:33 +0000
Organization: Symantec Corp.
Eduardo Suastegui wrote:
>
> Michael Schuerig <uzs90z@uni-bonn.de> wrote in article
> <1997020112093920404@rhrz-ts2-p12.rhrz.uni-bonn.de>...
> > You need to get the MRJ SDK for that. <http://applejava.apple.com/>.
>
> I have downloaded MRJ, and I have tried to run .class files. But as I said...
You need the MRJ SDK for that. Oh, that's what the last guy said. Let's
try this: Just the MRJ isn't enough, you also need to download the MRJ
SDK. It has an application named JRunner that does what you want.
Bob
+++++++++++++++++++++++++++
>From gmcgath@mv.mv.com (Gary McGath)
Date: Thu, 06 Feb 1997 10:25:17 -0500
Organization: Conceptual Design
In article <32F3AE38.670C@worldnet.att.net>, rfoster@symantec.com wrote:
>You need the MRJ SDK for that. Oh, that's what the last guy said. Let's
>try this: Just the MRJ isn't enough, you also need to download the MRJ
>SDK. It has an application named JRunner that does what you want.
The inclusion of JRunner only with the SDK seems to suggest that Java
applications "aren't ready for prime time," at least on the Mac. This is
rather unfortunate, since my client has had me doing a series of applets
which really push the limits of the applet paradigm; e.g., lack of file
access limits what they can do. I hope this will be changing in the near
future.
--
Gary McGath gmcgath@mv.mv.com
http://www.ultranet.com/~gmcgath
If you've recently seen a newsgroup spam with my name forged
to it, please read http://www.ultranet.com/~gmcgath/forginfo.html
+++++++++++++++++++++++++++
>From "Eduardo Suastegui" <esuastegui@msn.com>
Date: Fri, 07 Feb 1997 21:53:04 -0800
Organization: My Happy Home
Michael Schuerig <uzs90z@uni-bonn.de> wrote in article
<1997020112093920404@rhrz-ts2-p12.rhrz.uni-bonn.de>...
>
> You need to get the MRJ SDK for that. <http://applejava.apple.com/>.
>
> Michael
>
> ---
Well, that did the trick... After I struggled a bit. The only way I could
get it to work was to:
1) Compress all my classes into a single ZIP file, storing the relative
paths for all the .class files.
2) Drag-drop the .ZIP file onto JRunner.
3) Select Save Settings, and click on Create Application.
4) Save the application into the same directory where my .ZIP file, and
other files were located.
Drag-dropping the .ZIP file onto JRunner and pressing the Execute button
did not do it, because all calls to getDocumentBase() would return the
absolute path for JRunner and _not_ for my .ZIP file (i.e., applet
classes). Quite an education!
Hope my fumbling along helps others.
Ed Suastegui
+++++++++++++++++++++++++++
>From gchapman@irus.rri.uwo.ca (Greg Chapman)
Date: Wed, 12 Feb 1997 16:07:11 -0500
Organization: John P. Robarts Research Institute
In article <gmcgath-ya02408000R0602971025170001@nh.ultranet.com>,
gmcgath@mv.mv.com (Gary McGath) wrote:
> rather unfortunate, since my client has had me doing a series of applets
> which really push the limits of the applet paradigm; e.g., lack of file
> access limits what they can do. I hope this will be changing in the near
That's not pushing the 'applet paradigm', it's pushing the applet Security
policies...
--
Greg Chapman
Mac Developer - Robarts Research Institute
Imaging Research Labs
- -
"You! Out of the gene pool!"
---------------------------
>From Geoff@CalibanMW.com (Geoff Price)
Subject: SFGetFile feeding Finder doc info automatically?
Date: Wed, 12 Feb 1997 17:24:52 -0800
Organization: Caliban Mindwear
Under what conditions does the Finder initiate opening a document by
simulating a File->Open and feeding the info automatically through the
SFreply parameter in the subsequent call to SFGetFile()?
(Or, what am I confused about?)
I was stepping through this app to figure out why it wasn't calling the
installed apple event handlers for the core suite deals (i.e.
kAEOpenApplication), yet was still able to open documents dropped from the
Finder. After I dropped the document, I watched the app respond as if the
"Open" menu item under the "File" menu had been selected, but when it
reached the SFGetFile() API call no dialog appeared, instead the
appropriate info from the dragged doc just got fed in automatically
through the SFReply struct.
What enables this behavior? I can't find a mention of this in any docs.
Everything else in the app conforms to what I know about AE handling (four
calls to AEInstallEventHandler for the core events, etc.)
Meanwhile I'm trying to handle the kAEOpenApplication event properly (i.e.
open an untitled doc), but not getting it. This is old code which I've
updated to universal headers, so one possibility I wanted to check here
was problems with the new procptrs. But the above behavior caught my
attention first.
--
Geoff Price
Geoff@CalibanMW.com
+++++++++++++++++++++++++++
>From Stephen C. Gilardi <squeegee@concentric.net>
Date: 15 Feb 1997 17:00:20 GMT
Organization: SQ Software
In article <Geoff-1202971724520001@max1-084.snlo.dialup.callamer.com>
Geoff Price, Geoff@CalibanMW.com writes:
>I was stepping through this app to figure out why it wasn't calling the
>installed apple event handlers for the core suite deals (i.e.
>kAEOpenApplication), yet was still able to open documents dropped from the
>Finder. After I dropped the document, I watched the app respond as if the
>"Open" menu item under the "File" menu had been selected, but when it
>reached the SFGetFile() API call no dialog appeared, instead the
>appropriate info from the dragged doc just got fed in automatically
>through the SFReply struct.
One thing to check is whether or not the "IsHighLevelEventAware" bit is
set in the application's SIZE resource. It's one of those flags that
you can set in the CodeWarrior Project Settings dialog. It's under "PPC
Project" or "68K Project" in the popup menu labeled "SIZE Flags".
To receive AppleEvents, the flag should be set.
--Steve
--
Stephen C. Gilardi
SQ Software
+++++++++++++++++++++++++++
>From davep@best.nospam.com (Dave Polaschek)
Date: Sat, 15 Feb 1997 11:56:54 -0600
Organization: Polaschek Publishing
In article <Geoff-1202971724520001@max1-084.snlo.dialup.callamer.com>,
Geoff@CalibanMW.com (Geoff Price) wrote:
> I was stepping through this app to figure out why it wasn't calling the
> installed apple event handlers for the core suite deals (i.e.
> kAEOpenApplication), yet was still able to open documents dropped from the
> Finder. After I dropped the document, I watched the app respond as if the
> "Open" menu item under the "File" menu had been selected, but when it
> reached the SFGetFile() API call no dialog appeared, instead the
> appropriate info from the dragged doc just got fed in automatically
> through the SFReply struct.
Finder does this for you when your application looks like it doesn't
respond to Apple Events.
> Meanwhile I'm trying to handle the kAEOpenApplication event properly (i.e.
> open an untitled doc), but not getting it. This is old code which I've
> updated to universal headers, so one possibility I wanted to check here
> was problems with the new procptrs. But the above behavior caught my
> attention first.
Make sure you have the "Accepts High Level Events" flag set in your 'SIZE'
resource. That's how finder can tell if you accept Apple Events.
-DaveP
--
Dave Polaschek - personal: davep@best.com or davep@mn.uswest.net
PGP key and other spiffy things at <http://www.best.com/~davep/>
+++++++++++++++++++++++++++
>From Geoff@CalibanMW.com (Geoff Price)
Date: Mon, 17 Feb 1997 21:06:47 -0800
Organization: Caliban Mindwear
In article <5e4q34$hb6@chronicle.concentric.net>, Stephen C. Gilardi
<squeegee@concentric.net> wrote:
> In article <Geoff-1202971724520001@max1-084.snlo.dialup.callamer.com>
> Geoff Price, Geoff@CalibanMW.com writes:
>
> >I was stepping through this app to figure out why it wasn't calling the
> >installed apple event handlers for the core suite deals (i.e.
> >kAEOpenApplication), yet was still able to open documents dropped from the
> >Finder. After I dropped the document, I watched the app respond as if the
> >"Open" menu item under the "File" menu had been selected, but when it
> >reached the SFGetFile() API call no dialog appeared, instead the
> >appropriate info from the dragged doc just got fed in automatically
> >through the SFReply struct.
>
> One thing to check is whether or not the "IsHighLevelEventAware" bit is
> set in the application's SIZE resource. It's one of those flags that
> you can set in the CodeWarrior Project Settings dialog. It's under "PPC
> Project" or "68K Project" in the popup menu labeled "SIZE Flags".
>
> To receive AppleEvents, the flag should be set.
>
Yep, I looked in the wrong place first (ResEdit) and got confused. Thanx.
--
Geoff Price
Geoff@CalibanMW.com
+++++++++++++++++++++++++++
>From pelak@sage.msc.cornell.edu (Robert A. Pelak)
Date: 18 Feb 1997 15:39:41 GMT
Organization: Cornell University
In article <davep-1502971156550001@dialup6.mn.uswest.net>,
Dave Polaschek <davep@best.nospam.com> wrote:
>In article <Geoff-1202971724520001@max1-084.snlo.dialup.callamer.com>,
>Geoff@CalibanMW.com (Geoff Price) wrote:
>
>> I was stepping through this app to figure out why it wasn't calling the
>> installed apple event handlers for the core suite deals (i.e.
>> kAEOpenApplication), yet was still able to open documents dropped from the
>> Finder. After I dropped the document, I watched the app respond as if the
>> "Open" menu item under the "File" menu had been selected, but when it
>> reached the SFGetFile() API call no dialog appeared, instead the
>> appropriate info from the dragged doc just got fed in automatically
>> through the SFReply struct.
>
>Finder does this for you when your application looks like it doesn't
>respond to Apple Events.
>
How does Finder know how to do this? What are the parameters? I have
an application that I maintian that still runs under System 6 that
does this, and I've always wondered about it. Can you tell me more or
point me toward more information?
>
>-DaveP
>
>--
>Dave Polaschek - personal: davep@best.com or davep@mn.uswest.net
>PGP key and other spiffy things at <http://www.best.com/~davep/>
Robert
+++++++++++++++++++++++++++
>From davep@best.nospam.com (Dave Polaschek)
Date: Tue, 18 Feb 1997 22:17:10 -0600
Organization: Polaschek Publishing
In article <5ecift$he8@newsstand.cit.cornell.edu>,
pelak@sage.msc.cornell.edu (Robert A. Pelak) wrote:
> In article <davep-1502971156550001@dialup6.mn.uswest.net>,
> Dave Polaschek <davep@best.nospam.com> wrote:
> >Finder does this for you when your application looks like it doesn't
> >respond to Apple Events.
> >
>
> How does Finder know how to do this? What are the parameters? I have
> an application that I maintian that still runs under System 6 that
> does this, and I've always wondered about it. Can you tell me more or
> point me toward more information?
Finder patches StandardGetFile (or an associated lower-level trap) and
then launches your application, and feeds you an event saying that the
item in your file menu with the name "Open" (or with 'O' as its command-
key, it'll try pretty hard to find it) was selected. When the dialog
comes up in response to that event, finder fills in the SFReply for you,
and as if by magic, the document is opened.
Actually, where I say "Finder", I probably mean "Process Manager", but
since they live together....
I'm pretty sure it's documented SOMEWHERE, but can't put my finger on
where at the moment.
-DaveP
--
Dave Polaschek - personal: davep@best.com or davep@mn.uswest.net
PGP key and other spiffy things at <http://www.best.com/~davep/>
---------------------------
>From briank@ctdnet.acns.nwu.edu (Brian Kendall)
Subject: Stereo sound?
Date: Tue, 11 Feb 1997 18:16:13 -0400
Organization: Programmer
Hi there!
Is there a way to pan sounds before you play them or while your playing
them? There doesn't seem to be much of a way to do this using what I know
of the Sound Manager.
(I have two speaks hooked up to an amplifier that my mac is hooked up to
so I do get very clear stereo sound. I've tried fooling around with the
music application PlayerPRO with stereo and everything went smoothly.)
Brian K.
ãããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããã
"If you take cranberries and stew them like applesauce,
it tastles much more like prunes then rhubarb does." - Groucho Marx
ãããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããã
+++++++++++++++++++++++++++
>From michael@nfocomm.com (Michael Connolly)
Date: Wed, 12 Feb 1997 15:27:53 -0600
Organization: <none>
In article <briank-1102971816130001@pistachio186191.nuts.nwu.edu>,
briank@ctdnet.acns.nwu.edu (Brian Kendall) wrote:
> Hi there!
>
> Is there a way to pan sounds before you play them or while your playing
> them? There doesn't seem to be much of a way to do this using what I know
> of the Sound Manager.
>
> Brian K.
Get the Inside Macintosh: Sound book in print or at the
ftp.apple.com/devworld site in DocViewer format. From what I know, if
your sound was recorded in stereo, it can be played back that way, and the
Sound Manager 3 may provide more control over this. It does provide more
control over multiple sound channel volumes.
- --
Michael Connolly <michael@nfocomm.com>
- --
Check out the CyberJibe web page (a humor newsletter/ Webzine) at
http://www.visionx.com/funny/
- -
+++++++++++++++++++++++++++
>From jackw@cdc.net (Jack W)
Date: 13 Feb 1997 04:43:49 GMT
Organization: Chattanooga Data Connection Inc.
In article <briank-1102971816130001@pistachio186191.nuts.nwu.edu>
briank@ctdnet.acns.nwu.edu (Brian Kendall) writes:
> Is there a way to pan sounds before you play them or while your playing
> them? There doesn't seem to be much of a way to do this using what I know
> of the Sound Manager.
Tricks of the Mac Game Programming Gurus has a library of sound
routines which include setting the panning of stereo sounds.
Jack W.
+++++++++++++++++++++++++++
>From zink@uiuc.edu (Dan Zink)
Date: Fri, 14 Feb 1997 11:25:18 -0600
Organization: University of Illinois
In article <5du665$g3h@cdc2.cdc.net>, jackw@cdc.net (Jack W) wrote:
> In article <briank-1102971816130001@pistachio186191.nuts.nwu.edu>
> briank@ctdnet.acns.nwu.edu (Brian Kendall) writes:
>
> > Is there a way to pan sounds before you play them or while your playing
> > them? There doesn't seem to be much of a way to do this using what I know
> > of the Sound Manager.
>
> Tricks of the Mac Game Programming Gurus has a library of sound
> routines which include setting the panning of stereo sounds.
>
> Jack W.
Do this:
rightVolume and leftVolume should be between 0 and 256.
SndCommand theCommand;
OSErr theErr;
theCommand.cmd = volumeCmd; // Send volumeCmd to get stereo.
theCommand.param1 = 0;
theCommand.param2 = ((rightVolume << 16) + leftVolume);
theErr = SndDoImmediate(channelPtr, &theCommand);
Have fun!
-Dan
http://www.cen.uiuc.edu/~zink
---------------------------
End of C.S.M.P. Digest
**********************